/*
2021-7-16
https://www.acwing.com/problem/content/329/
*/
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;
const int N=14,M=1<<12,mod=1e8;
int g[N];
vector<int> state;
vector<int> head[M];
int n,m;
int f[N][M];

bool check(int x)
{
    return !(x&x>>1);
}

int main()
{
    ios::sync_with_stdio(false);
    cout.tie(NULL);
    cin>>n>>m;
    
    for(int i=1;i<=n;i++)
        for(int j=0;j<m;j++)
        {
            int x;
            cin>>x;
            g[i]+=!x<<j;
        }
    
    for(int i=0;i<1<<m;i++)
    {
        if(check(i))
            state.push_back(i);
    }
    
    for(int i=0;i<state.size();i++)
        for(int j=0;j<state.size();j++)
        {
            int a=state[i],b=state[j];
            if((a&b)==0) head[i].push_back(j);
        }
    
    f[0][0]=1;
    for(int i=1;i<=n+1;i++)
        for(int a=0;a<state.size();a++)
            if((state[a]&g[i])==0)
                for(int b:head[a])
                {
                    f[i][a]=(f[i][a]+f[i-1][b])%mod;
                }
    
    cout<<f[n+1][0]<<endl;
    
    return 0;
}
